<?php
App::uses('AppModel', 'Model');
/**
 * Modified by Vu 17/05/2013
 *
 * Timesheet Model
 *
 * @property User $User
 */
class Timesheet extends AppModel {

/**
 * Validation rules
 *
 * @var array
 */
	public $validate = array(
		'user_id' => array(
			'notempty' => array(
				'rule' => array('notempty'),
			),
            'unique_id'=> array(
                'rule'=> 'isUnique',
                'message'=> 'User ID already exists. Please choose a different ID.',
            ),
		),

		'name' => array(
			'notempty' => array(
				'rule' => array('notempty'),
			),
		),

		'date' => array(
			'date' => array(
				'rule' => array('date'),
			),
		),

		'start_time' => array(
			'notempty' => array(
				'rule' => array('notempty'),
			),
		),

		'end_time' => array(
			'notempty' => array(
				'rule' => array('notempty'),
			),
		),
	);




	//The Associations below have been created with all possible keys, those that are not needed can be removed

/**
 * belongsTo associations
 *
 * @var array
 */
	public $belongsTo = array(
		'User' => array(
			'className' => 'User',
			'foreignKey' => 'user_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
}
